/**
 * 3
 *  
 * @Author : roryrywang
 * @DateTime : 24-8-25 下午6:51
 */

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <unordered_set>

using namespace std;

int main() {
    int n, m, q;
    cin >> n >> m >> q;

    vector<int> edge[n + 1];
    for (int i = 0; i < m; ++i) {
        int a, b;
        cin >> a >> b;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }

    vector<int> st(n + 1);
    for (int i = 1; i <= n; ++i) {
        cin >> st[i];
    }

    bool visited[n + 1];
    for (int i = 1; i <= n; ++i) {
        visited[i] = false;
    }

    vector<int> res(n + 1);

    for (int i = 1; i <= n; ++i) {
        unordered_set<int> set;
        int ans = 1;
        if (!visited[i] && st[i] == 1) {
            queue<int> qu;
            qu.push(i);
            visited[i] = true;
            set.insert(i);
            while (!qu.empty()) {
                int people = qu.front();
                qu.pop();
                if (st[people] == 1) {
                    for (int sayTo: edge[people]) {
                        if (!set.count(sayTo)) {
                            ans++;
                            qu.push(sayTo);
                            visited[sayTo] = true;
                            if (st[i] == 1) set.insert(sayTo);
                        }
                    }
                }
            }
        }
        for (auto k: set) {
            res[k] = ans;
        }
    }
    while (q--) {
        int u;
        cin >> u;
        if (st[u] == 2) {
            cout << 1 << endl;
        } else {
            cout << res[u] << endl;
        }
    }

    return 0;
}